The CDF_CONTROL procedure allows you to obtain or set information for a Common Data Format file, its variables, and its attributes.
CDF_CONTROL, Id [, ATTRIBUTE=name or number] [, GET_ATTR_INFO=variable] [, GET_CACHESIZE=variable] [, GET_COPYRIGHT=variable] [, GET_FILENAME=variable] [, GET_FORMAT=variable] [, GET_NEGTOPOSFP0_MODE=variable] [, GET_NUMATTRS=variable] [, GET_READONLY_MODE=variable] [, GET_RVAR_CACHESIZE=variable] [, GET_VAR_INFO=variable] [, GET_ZMODE=variable] [, GET_ZVAR_CACHESIZE=variable] [, SET_CACHESIZE=value] [, SET_EXTENDRECS=records] [, SET_INITIALRECS=records] [, /SET_NEGTOPOSFP0_MODE] [, SET_PADVALUE=value] [, /SET_READONLY_MODE] [, SET_RVAR_CACHESIZE=value{See Note}] [, SET_RVARS_CACHESIZE=value{See Note}] [, SET_ZMODE={0 | 1 | 2}] [, SET_ZVAR_CACHESIZE=value{See Note}] [, SET_ZVARS_CACHESIZE=value{See Note}] [, VARIABLE=name or index] [, /ZVARIABLE]
Note: Use only with MULTI_FILE CDF files
The CDF ID of the file being changed or queried, as retuned from a previous call to CDF_OPEN or CDF_CREATE.
Makes the attribute specified the current attribute. Either an attribute name or an attribute number may be specified.
Set this keyword to a named variable that will contain information about the current attribute. Information is returned in the form of a structure with the following tags:
{ NUMGENTRIES:0L, NUMRENTRIES:0L, NUMZENTRIES:0L,
MAXGENTRY:0L, MAXRENTRY:0L, MAXZENTRY:0L }
The first three tags contain the number of globals, rVariables, and zVariables associated with the attribute. MAXGENTRY contains the highest index used, and the last two tags contain the highest variable ids that were used when setting the attribute’s value.
Note that an attribute must be set before GET_ATTR_INFO can be used. For example:
CDF_CONTROL, id, ATTRIBUTE='ATT1', GET_ATTR_INFO=X
Set this keyword to a named variable that will be set equal to the number of 512-byte cache buffers being used for the current.cdf file. For discussion about using caches with CDF files, see “Caching Scheme” in the CDF User’s Guide.
Set this keyword to a named variable that will contain the copyright notice of the CDF library now being used by IDL (as opposed to the library that was used to write the current CDF).
Set this keyword to a named variable that will contain the pathname of the current .cdf file.
Set this keyword to a named variable that will contain a string describing the CDF Format of the current CDF file. Possible formats are SINGLE_FILE and MULTI_FILE, and can only be set with the CDF_CREATE procedure. For example:
id = CDF_CREATE('single', /SINGLE_FILE)
CDF_CONTROL, id, GET_FORMAT = cdfformat
HELP, cdfformat
IDL prints:
CDFFORMAT STRING = 'SINGLE_FILE'
Set this keyword to a named variable that will be set equal to the CDF negative to positive floating point 0.0 (NEGtoPOSfp0) mode. In NEGtoPOSfp0 mode, values equal to -0.0 will be converted to 0.0 whenever encountered. By CDF convention, a returned value of -1 indicates that this feature is enabled, and a returned value of zero indicates that this feature is disabled.
Set this keyword to a named variable that will contain a two-element array of longs. The first value will contain the number of attributes with global scope; the second value will contain the number of attributes with variable scope. NOTE: attributes with GLOBAL_SCOPE_ASSUMED scope will be included in the global scope count and attributes with VARIABLE_SCOPE_ASSUMED will be included in the count of attributes with variable scope.
Note that you can obtain the total number of attributes using the CDF_INQUIRE routine.
Set this keyword to a named variable that will be set equal to the CDF read-only mode. By CDF convention, a returned value of -1 indicates that the file is in read-only mode, and a returned value of zero indicates that the file is not in read-only mode.
Set this keyword to a named variable that will be set equal to the number of 512-byte cache buffers being used for the current MULTI_FILE format CDF and the rVariable indicated by the VARIABLE keyword. This keyword should only be used for MULTI_FILE CDF files. For discussion about using caches with CDF files, see “Caching Scheme” in the CDF User’s Guide.
Set this keyword to a named variable that will contain information about the current variable. For detailed information about the returned values, see “Records” in the CDF User’s Guide. Information is returned in the form of a structure with the following tags:
{ EXTENDRECS:0L, MAXALLOCREC:0L, MAXREC:0L,
MAXRECS:0L, NINDEXENTRIES:0L, NINDEXRECORDS:0L,
PADVALUE:<as appropriate> }
The EXTENDRECS field will contain the number of records by which the current variable will be extended whenever a new record needs to be added.
The MAXALLOCREC field will contain the maximum record number (zero-based) allocated for the current variable. Records can only be allocated for NOVARY zVariables in SINGLE_FILE format CDFs. When these conditions are not met, the value is set to -1.
The MAXREC field will contain the maximum record number for the current variable. For variables with a record variance of NOVARY, this will be at most zero. A value of -1 indicates that no records have been written.
The MAXRECS field will contain the maximum record number (zero-based) of all variables of this type (rVariable or zVariable) in the current CDF. A value of -1 indicates that no records have been written.
The NINDEXENTRIES field will contain the number of index entries for the current variable in the current CDF. This value is -1 unless the current CDF is of SINGLE_FILE format, and the variable is a zVariable.
The NINDEXRECORDS field will contain the number of index records for the current variable in the current CDF. This value is -1 unless the current CDF is of SINGLE_FILE format, and the variable is a zVariable.
The PADVALUE field will contain the value being used to fill locations that are not explicitly filled by the user. If a PADVALUE is not specified, CDF_CONTROL returns an error.
For example:
fid = CDF_CREATE('test.cdf')
varid = CDF_VARCREATE(fid, 'test')
CDF_CONTROL, fid, GET_VAR_INFO=info, VARIABLE='test'
IDL Prints:
% CDF_CONTROL: Function completed but
NO_PADVALUE_SPECIFIED: A pad value has not been specified.
Set this keyword to a named variable that will be set equal the zMode of the current CDF. In a non-zero zMode, CDF rVariables are temporarily replaced with zVariables. The possible return values are:
For Information about zModes, see “CDF Modes” in the CDF User’s Guide.
Set this keyword to a named variable that will be set equal to the number of 512-byte cache buffers being used in the current MULTI_FILE format CDF and the zVariable indicated by the VARIABLE keyword. This keyword should only be used with MULTI_FILE CDF files. For discussion about using caches with CDF files, see “Caching Scheme” in the CDF User’s Guide.
Set this keyword equal to the desired number of 512-byte cache buffers to used for the current .cdf file. For discussion about using caches with CDF files, see “Caching Scheme” in the CDF User’s Guide.
Set this keyword equal to the number of additional physical records that should be added to the current variable whenever it needs to be extended.
Set this keyword equal to the number of records that should be initially written to the current variable. Note that this keyword should be set before writing any data to the variable.
Set this keyword to a non-zero value to put the current CDF file into negative to positive floating point 0.0 (NEGtoPOSfp0) mode. In this mode, values equal to -0.0 will be converted to 0.0 whenever encountered. Setting this keyword equal to zero takes the current CDF file out of NEGtoPOSfp0 mode.
Set this keyword equal to the pad value for the current variable.
Set this keyword to a non-zero value to put the current CDF file into read-only mode. Set this keyword equal to zero to take the current CDF file out of read-only mode.
Set this keyword equal to the desired number of 512-byte cache buffers to used for the rVariable file specified by the VARIABLE keyword. This keyword should only be used with MULTI_FILE CDF files. For discussion about using caches with CDF files, see “Caching Scheme” in the CDF User’s Guide.
Set this keyword equal to the desired number of 512-byte cache buffers to used for all rVariable files in the current CDF file or files. This keyword should only be used with MULTI_FILE CDF files. For discussion about using caches with CDF files, see “Caching Scheme” in the CDF User’s Guide.
Set this keyword to change the zMode of the current CDF. In a non-zero zMode, CDF rVariables are temporarily replaced with zVariables. Set this keyword to one (1) to change to zMode/1, in which the dimensionality and variances of the variables stay the same. Set this keyword to two (2) to change to zMode/2, in which those dimensions with false variances (NOVARY) are eliminated. For Information about zModes, see “CDF Modes” in the CDF User’s Guide.
Set this keyword equal to the desired number of 512-byte cache buffers to used for the zVariable’s file specified by the VARIABLE keyword. This keyword should only be used with MULTI_FILE CDF files. For discussion about using caches with CDF files, see “Caching Scheme” in the CDF User’s Guide.
Set this keyword equal to the desired number of 512-byte cache buffers to used for all zVariable files in the current CDF. This keyword should only be used with MULTI_FILE CDF files. For discussion about using caches with CDF files, see “Caching Scheme” in the CDF User’s Guide.
Set this keyword to a name or index to set the current variable. The following example specifies that the variable MyData should have 20 records written to it initially:
CDF_CONTROL, id, VAR='MyData', SET_INITIALRECS=20
Note that if VARIABLE is set to the index of a zVariable, the ZVARIABLE keyword must also be set. If ZVARIABLE is not set, the variable is assumed to be an rVariable.
Set this keyword to TRUE if the current variable is a zVariable and is referred to by index. For example:
CDF_CONTROL, id, VARIABLE=0, /ZVARIABLE, GET_VAR_INFO=V
Pre 4.0 |
Introduced |